package com.dg.acb.utils.xml;

import java.util.ArrayList;
import java.util.List;

public class NBXmlTag extends ABaseTag {
    private final List<XmlTag> mSubTags = new ArrayList<XmlTag>();

    private NBXmlTag(String name, String value) {
        super(name, value);
    }

    public static NBXmlTag obtain(String name) {
        return new NBXmlTag(name, null);
    }

    public static NBXmlTag obtain(String name, String value) {
        return new NBXmlTag(name, value);
    }

    @Override
    public boolean hasSubTags() {
        return mSubTags.size() > 0;
    }

    @Override
    public void addSubTag(XmlTag tag) {
        mSubTags.add(tag);
    }

    @Override
    public List<XmlTag> getSubTags() {
        return mSubTags;
    }

    @Override
    public void recycle() {
        mSubTags.clear();
        super.recycle();
    }
}
